import {BasicColumn} from '/@/components/Table';
import {FormSchema} from '/@/components/Table';
import { rules} from '/@/utils/helper/validator';
import { render } from '/@/utils/common/renderUtils';
import { getWeekMonthQuarterYear } from '/@/utils';
//列表数据
export const columns: BasicColumn[] = [
   {
    title: '会员信息',
    align:"center",
    dataIndex: 'userId_dictText'
   },
   {
    title: '积分变动点数',
    align:"center",
    dataIndex: 'modifyPoint'
   },
   {
    title: '当前点数',
    align:"center",
    dataIndex: 'nowPoint'
   },
];
//查询数据
export const searchFormSchema: FormSchema[] = [
	{
      label: "会员信息",
      field: 'userId',
      component: 'JSearchSelect',
      componentProps:{
         dict:"sys_user,username,id"
      },
      //colProps: {span: 6},
 	},
];
//表单数据
export const formSchema: FormSchema[] = [
  {
    label: '会员信息',
    field: 'userId',
    component: 'JSearchSelect',
    componentProps:{
       dict:"sys_user,username,id"
    },
  },
  {
    label: '积分变动点数',
    field: 'modifyPoint',
    component: 'InputNumber',
  },
  {
    label: '当前点数',
    field: 'nowPoint',
    component: 'InputNumber',
  },
	// TODO 主键隐藏字段，目前写死为ID
	{
	  label: '',
	  field: 'id',
	  component: 'Input',
	  show: false
	},
];

// 高级查询数据
export const superQuerySchema = {
  userId: {title: '会员信息',order: 0,view: 'sel_search', type: 'string',dictTable: "sys_user", dictCode: 'id', dictText: 'username',},
  modifyPoint: {title: '积分变动点数',order: 1,view: 'number', type: 'number',},
  nowPoint: {title: '当前点数',order: 2,view: 'number', type: 'number',},
};

/**
* 流程表单调用这个方法获取formSchema
* @param param
*/
export function getBpmFormSchema(_formData): FormSchema[]{
  // 默认和原始表单保持一致 如果流程中配置了权限数据，这里需要单独处理formSchema
  return formSchema;
}